<template>
  <div class="baseInfo">
    <vxe-table
      border
      stripe
      ref="tableRef"
      size="small"
      header-align="center"
      :data="tableData"
    >
      <vxe-column type="seq" width="70" align="center" fixed="left"></vxe-column>
      <vxe-column field="createBy" show-overflow="title" align="center" title="操作人"></vxe-column>
      <vxe-column field="opType" show-overflow="title" align="center" title="操作类型"></vxe-column>
      <vxe-column field="createTime" show-overflow="title" align="center" title="操作时间"></vxe-column>
      <vxe-column field="remark" show-overflow="title" align="center" title="备注"></vxe-column>
    </vxe-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { getOpLogList } from "@/api/mes/sales/oplog";
export default {
  name: 'baseInfo',
  props: {
    cellId: undefined,
    poStatus: undefined,
  },
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      tableData: [],
      total: 0,
    }
  },
  watch: {
    cellId: {
      handler() {
        this.getList();
      },
    }
  },
  methods: {
    getList() {
      getOpLogList({
        objectId: this.cellId,
        objectType: 'prepare',
      }).then(response => {
        this.tableData = response.rows;
        this.total = response.total;
        console.log('response', response);
      });
    },
  }
}
</script>

<style lang="scss" scoped>
.baseInfo{
  &-header{
    margin-bottom: 10px;
  }
}
</style>